/*=============================================================================

  MANAGER IDLE MODE MODULE

  FILE: SYSmgr_S_MANUAL.cpp

  DESCRIPTION

  Manager Measurement Mode Implementation

  EXTERNALIZED FUNCTIONS


  Copyright (c) DaeSung Engineering Inc. All rights reserved.

=============================================================================*/
/*=============================================================================

  EDIT HISTORY

  ---------  -------  -------------------------------------------------------
    when       who     what, where, why
  ---------  -------  -------------------------------------------------------
    06/28/03   nso4th   Version 0.1

=============================================================================*/

/*=============================================================================
  HEADER INCLUSION
=============================================================================*/
#include <SYSmgr.h>

/*=============================================================================
MACRO DEFINITION
=============================================================================*/
#define SETSTEP(s)		((gStep) = (s))
#define GETSTEP()		(gStep)

/*=============================================================================
CONSTANT DEFINITION
=============================================================================*/

/*=============================================================================
LOCALIZED VARIABLE DEFINITION
=============================================================================*/
static dword	gStep = STATE_INIT_STEP;

/*=============================================================================
EVENT PROCESSING
=============================================================================*/
dword SYSmgr::RESET_STATE(dword dwType, dword dwEvent, dword wParam, dword lParam)
{
	dword		st = m_mnState[RESET_S];

	switch(st)
	{
	case RESET_IDL_S:
		return	RESET_ProcIDL(dwType, dwEvent, wParam, lParam);

	case RESET_RESET_S:
		return	RESET_ProcRESET(dwType, dwEvent, wParam, lParam);

	case RESET_HOME_S:
		return  RESET_ProcHOME(dwType, dwEvent, wParam, lParam);
	}

	return	FALSE;
}

dword SYSmgr::RESET_ProcIDL(dword dwType, dword dwEvent, dword wParam, dword lParam)
{
	dword		event, evtID;

	event = HDEV_GETEVENT(dwEvent);
	evtID = HDEV_GETDEV_ID(dwEvent);

	if(IS_CMD_EVENT(dwType) == FALSE)
		return	FALSE;

	switch(event)
	{
	case STATE_STOP_C:
	{
		SETSTEP(STATE_INIT_STEP);
		State_Change(IDL_S, IDL_IDL_S);
		break;
	}
	case RESET_START_C:
	{
		SETSTEP(STATE_INIT_STEP);
		State_Minor(RESET_RESET_S);
		break;
	}
	case RESET_HOME_C:
	{
		m_homeReq = wParam;
		SETSTEP(STATE_INIT_STEP);
		State_Minor(RESET_HOME_S);
		break;
	}

	}

	return	FALSE;
}

/*--- END OF SYSmgr_S_RESET.CPP ---*/
